<@override name="script">
    <script>
        layui.use(["element", "form", "table", "layer", "laydate", "layedit","upload"], function () {
            var element = layui.element;
            var form = layui.form;
            var table = layui.table;
            var layer = layui.layer;
            var laydate = layui.laydate;
            var layedit = layui.layedit;
            var upload = layui.upload;
            
			
			//表单提交
            form.on('submit(save)', function (data) {
	        	jQuery.ajax({
	            	url: "${rc.contextPath}/admin/student/update",
	                type: "post",
	                dataType: "json",
	                data: data.field,
	                success: function (data, textStatus, jqXHR) {
	                	if (data.code != "1") {
	                    	layer.msg(data.msg, {icon: 2, time: 2000});
	                        return;
	                    }
                      	layer.msg("保存成功!", {icon: 1, time: 1000}, function () {
                        	//window.history.go(-1);
                        	location.href="${rc.contextPath}/admin/student/table.html";
                      	});
	                  },
	                error: function () {
	                      layer.msg("请求服务器异常", {icon: 2, time: 2000});
	                }
	            });
	            return false;
	        });
        });
    </script>
</@override> 

<@override name="breadcrumb">
    <a><cite>编辑学生</cite></a>
</@override> 

<@override name="content">
    <div class="layui-body">
        <div class="layui-content-page">
            <form id="dialogform" class="layui-form" lay-filter="value">
                <input type="hidden" value="${model.id?c!''}" id="id" name="id"/>
                <div class="layui-row">
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">姓名</label>
                            <div class="layui-input-block">
                                <input type="text" id="name" name="name" value="${model.name!''}" autocomplete="off" class="layui-input" lay-verify="required" lay-reqText="请填写学生姓名"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">学号</label>
                            <div class="layui-input-block">
                                <input type="text" id="sno" name="sno" value="${model.sno!''}" autocomplete="off" class="layui-input" lay-verify="required" lay-reqText="请填写学号"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">班级</label>
                            <div class="layui-input-block">
                            	<select id="clazzId" name="clazzId" class="layui-input">
                            		<option value="">请选择</option>
                            		<#if clazzIds??>
                            		<#list clazzIds as item>
                            		<option <#if (model.clazzId??&&model.clazzId==item.id)>selected="selected"</#if> value="${item.id!''}">${item.name!''}</option>
                            		</#list>
                            		</#if>
                            	</select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">手机号</label>
                            <div class="layui-input-block">
                                <input type="text" id="phone" name="phone" value="${model.phone!''}" autocomplete="off" class="layui-input" lay-verify="phone" lay-reqText=""/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">身份证</label>
                            <div class="layui-input-block">
                                <input type="text" id="idcard" name="idcard" value="${model.idcard!''}" autocomplete="off" class="layui-input" lay-verify="identity" lay-reqText=""/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">邮箱</label>
                            <div class="layui-input-block">
                                <input type="text" id="email" name="email" value="${model.email!''}" autocomplete="off" class="layui-input"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg6">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">学分</label>
                            <div class="layui-input-block">
                                <input type="text" id="credit" name="credit" value="${model.credit!''}" autocomplete="off" class="layui-input"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-lg12">
	                    <div class="layui-form-item">
	                        <div class="layui-input-block">
	                            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="save">提交保存 </button>
	                            <button class="layui-btn layui-btn-primary" type="button" onclick="window.history.go(-1);">返回 </button>
	                        </div>
	                    </div>
                    </div>
                </div>
                
            </form>
        </div>
    </div>
</@override> 

<@extends name="/admin/layout.html"/>